feat(miners): unbound OPEN issues when since is omitted#27
Merged
Conversation
When `since` is provided, behavior is unchanged: OPEN created on/after, CLOSED closed on/after — the scoring window. When `since` is omitted, the response now returns all currently-OPEN issues with no time bound and no CLOSED history. Callers asking for "current open-issue load" no longer need a synthetic epoch-since workaround that pulls a full all-time payload. Lets the validator's open-issue spam-multiplier count old still-open issues that fall outside the scoring lookback window — the gap called out in entrius/gittensor#929 / PR #930.
LandynDev
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sinceis provided, behavior is unchanged: OPEN issuescreated_at >= sinceplus CLOSED issuesclosed_at >= since(the scoring window).sinceis omitted, the response now contains all currently-OPEN issues with no time bound and no CLOSED history.Lets callers asking for "current open-issue load" stop using a synthetic epoch-since workaround that fetches a full all-time payload.
Why
Mirror clients currently have to pass
since=<35 days ago>for issue-discovery scoring AND a secondsince=<epoch>request to count current open-issue load — because OPEN issues older than the scoring window are otherwise invisible. The downstream consumer is the validator's open-issue spam multiplier (see entrius/gittensor#929 / PR #930): a miner with open issues older than 35 days currently gets a free pass on the spam gate.Two cleaner alternatives I considered:
open_issue_countsidecar field to the response. Workable but requires both endpoint and consumer to teach a new field.sincefilter on OPEN unconditionally. Breaks the documented "issues since X" contract for scoring callers.The since-aware behavior here keeps both contracts coherent: presence of
since= scoring window, absence ofsince= open-issue load snapshot.Diff
packages/das/src/api/miners/miners.service.tsgetIssuesacceptssince: string | null, response shape'ssinceis nowstring | null.($2::timestamptz IS NULL OR i.created_at >= $2). When$2is null the short-circuit returns TRUE and all OPEN rows match; CLOSED branch'si.closed_at >= $2evaluates null and yields no rows.packages/das/src/api/miners/miners.controller.tssince ?? nullthrough instead of callingMinersService.resolveSince(since). The PR route is untouched.summary/description/sincedocs updated to reflect both modes.MinersService.resolveSincestays — still used by the PR route.Test plan
since=<date>) get the same OPEN+CLOSED window as before — SQL plan unchanged when$2is non-null.sincereturns all OPEN issues across all repos the mirror tracks, no CLOSED rows.author_github_idindex for the no-since case (should be the same access path; the OPEN filter degenerates to a constant).getIssuesrely on the priorstring(non-null) parameter shape.Related
open_issue_countparsing field).